package cn.hadron.aa.action;
import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import cn.hadron.aa.entity.Article;
import cn.hadron.aa.service.*;
import com.opensymphony.xwork2.ActionSupport;
@Controller
@Scope("prototype")  
public class ArticleAction extends ActionSupport {
	private int id;
	private Article article;
	private String message;
	@Resource(name="articleService")
	private ArticleService as;
	@Action(value="detail", results={@Result(name="success",location="/article.jsp")})
	public String detail() throws Exception {
		article=as.get(id);
		return SUCCESS;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Article getArticle() {
		return article;
	}
	public void setArticle(Article article) {
		this.article = article;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public ArticleService getAs() {
		return as;
	}
	public void setAs(ArticleService as) {
		this.as = as;
	}
}
